#ifndef _DSWLOCALSNDPLAY_H
#define _DSWLOCALSNDPLAY_H

#include "base.h"

typedef std::list<int> LIST_PLAYTYPE_T, *LPLIST_PLAYTYPE_T;

class CDswlocalsndplay
{
public:
	CDswlocalsndplay(LPST_ENV_T pEnv);
	virtual ~CDswlocalsndplay();
public:
	void AppendPlayTypeNode(int nType, int nValue);
private:	
	static int cbInterruptStream(void *ctx){return ((CDswlocalsndplay*)ctx)->InterruptStream();};
	int InterruptStream(){return m_pEnv->bExit;};

	static void* cbLocalSndPlayThread(void* pParam){((CDswlocalsndplay*)pParam)->LocalSndPlayThread();return NULL;};
	void LocalSndPlayThread();
	void PlayLocalSnd(const char* pFileName);
	void PlayLocalSnd_fd(const char* pFileName);
private:
	LPST_ENV_T m_pEnv;
	pthread_t m_thread_id;
	pthread_mutex_t m_nLock;
	LIST_PLAYTYPE_T m_nPlayTypeList;
	char* m_pPCMPacket;
};

#endif

